package com.weixin.pay.service.impl;

import com.talkology.pilot.database.dao.AccessTokenMapper;
import com.talkology.pilot.database.model.AccessToken;
import com.weixin.pay.service.IAccessTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccessTokenServiceImpl implements IAccessTokenService {

    @Autowired
    private AccessTokenMapper mapper;

    @Override
    public AccessToken getInfo(Integer index) {
        return mapper.selectByPrimaryKey(index);
    }

    @Override
    public void add(AccessToken record) {
        mapper.insert(record);
    }

    @Override
    public void edit(AccessToken record) {
        mapper.updateByPrimaryKey(record);
    }

    @Override
    public void delete(Integer index) {
        mapper.deleteByPrimaryKey(index);
    }
}
